package com.example.bookcar.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @Description
 * @Author konglz
 * @Data 2023/3/1 17:16
 */
@Data
@ApiModel("统一的响应对象")
public class Result {
    @ApiModelProperty("响应结果状态(true:处理成功 false:处理失败)")
    private Boolean flag;
    @ApiModelProperty("响应的提示信息")
    private String message;
    @ApiModelProperty("响应数据")
    private Object data;
    public Result(){
    }
    /**
     * @param flag      响应状态
     * @param message   提示信息
     */
    public Result(Boolean flag, String message){
        this.flag = flag;
        this.message = message;
    }
    /**
     * @param flag      响应状态
     * @param message   提示信息
     * @param data      响应数据
     */
    public Result(Boolean flag, String message, Object data){
        this.flag = flag;
        this.message = message;
        this.data = data;
    }
}